Merge Join

The Join node is used to create joins between 2 tables, adding the join to the database schema. The Join node can be connected to any Select (excluding Multi Select), Preparation, and Column Operation nodes. The Join function combines columns (horizontally) from 2 tables, based on matching columns and according to the selected join type.

The Join node can be used to join tables from the data source, or to join data source tables with new tables generated by data cleansing and preparation functions. For example, both the Date Range and Summarize functions generate new tables; these can then be joined to the original table from the data source. At other times, you may have tables showing similar information that might be more user friendly for data analysts if combined into one table.

Note: relationship 'joins' between tables can be defined during the Data Model phase. These joins will be added at runtime during the query, rather than being stored in the database.

Create a Join

From the Data Flow:

  1. Drag the Join node onto the canvas and connect it to the two tables that are being joined.

  2. Select the Join node on the Canvas, and go to the Properties panel to configure the join:

    • Resulting Table Name: Name the new table.
    • Join Type: Choose the join type.
    • For more information, see Join Types.

    • Join Columns: For each table, select the column where the join is applied.

.

Copy the join script

Click Copy to copy the script that underlies this join to your clipboard. Tip: You can use this script when testing in the database.


Join Types

Choose from the following join types:

  • Full Outer Join: returns all rows from both tables.
  • Inner Join: returns all rows from both tables based on a matching column. Only returns rows where the matching column's values are identical.
  • Left Outer Join: returns all rows from the first / left table, and matching rows from the second / right table.
  • Right Outer Join: returns all rows from the second / right table, and matching rows from the first / left table.
  • Cross Join: returns a result set by multiplying the number of rows in the first table by the number of rows in the second table. The result is a table that returns all possible combinations of all rows from both tables.

Examples